function formatterIsValid(val) {
    if(val==0){
        return "失效";
    }
    if(val==1){
        return "正常";
    }
}
function openAddProducerDrugDialog() {
    openDlg("dlg","添加供应商")
}
function openModifyProducerDialog() {
    openModifyDlg("dg","fm","dlg","修改供应商")
}
function deleteProducer() {
    deleteData("dg","deleteProducer",searchProducerByParams);
}
function searchProducerByParams() {
    $("#dg").datagrid("load",{
        producerName:$("#producerName").val(),
        producerId:$("#producerId").val()
    })
}
function saveOrUpdateProducer() {
    var id = $("#id").val();
    var submitUrl = ctx + "saveProducer";
    if(!isEmpty(id)){
        submitUrl="updateProducer"
    }
    saveOrUpdate("fm",submitUrl,"dlg",searchProducerByParams);
}
function closeProducerDlg() {
    closeDlgData("dlg");
}
